package singleton.lazy;

/**
 * 静态内部类
 * 内部类被初始化时才创建
 * 静态内部类不会随着外部类加载和初始化而加载，被使用时才去加载
 */
public class Singleton6 {
    private Singleton6(){}

    private static class Inner{
        private static final Singleton6 instance = new Singleton6();
    }
    public static Singleton6 getInstance() {
        return Inner.instance;
    }
}
